
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/vector/api/fieldfunctions.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:33 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Docstrings for basic field functions &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
    <script src="../../../../_static/jquery.js"></script>
    <script src="../../../../_static/underscore.js"></script>
    <script src="../../../../_static/doctools.js"></script>
    <script src="../../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-sphinx.js"></script>
    
    <link rel="shortcut icon" href="../../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="fieldfunctions.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../search.html" />
    <link rel="next" title="Classical Mechanics" href="../../mechanics/index.html" />
    <link rel="prev" title="Essential Functions (Docstrings)" href="functions.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../mechanics/index.html" title="Classical Mechanics"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="functions.html" title="Essential Functions (Docstrings)"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" accesskey="U">The Physics Vector Module</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Docstrings for basic field functions</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="docstrings-for-basic-field-functions">
<h1>Docstrings for basic field functions<a class="headerlink" href="#docstrings-for-basic-field-functions" title="Permalink to this headline">¶</a></h1>
<section id="field-operation-functions">
<h2>Field operation functions<a class="headerlink" href="#field-operation-functions" title="Permalink to this headline">¶</a></h2>
<p>These functions implement some basic operations pertaining to fields
in general.</p>
<section id="curl">
<h3>curl<a class="headerlink" href="#curl" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.curl">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">curl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vect</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L12-L53"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.curl" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the curl of a vector field computed wrt the coordinate
symbols of the given frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>vect</strong> : Vector</p>
<blockquote>
<div><p>The vector operand</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame to calculate the curl in</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">curl</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v1</span> <span class="o">=</span> <span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">curl</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v2</span> <span class="o">=</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">curl</span><span class="p">(</span><span class="n">v2</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">R_x*R_y*R.y - R_x*R_z*R.z</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="divergence">
<h3>divergence<a class="headerlink" href="#divergence" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.divergence">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">divergence</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vect</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L56-L96"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.divergence" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the divergence of a vector field computed wrt the coordinate
symbols of the given frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>vect</strong> : Vector</p>
<blockquote>
<div><p>The vector operand</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The reference frame to calculate the divergence in</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">divergence</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v1</span> <span class="o">=</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">R</span><span class="o">.</span><span class="n">x</span><span class="o">+</span><span class="n">R</span><span class="o">.</span><span class="n">y</span><span class="o">+</span><span class="n">R</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">divergence</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">R_x*R_y + R_x*R_z + R_y*R_z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v2</span> <span class="o">=</span> <span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">divergence</span><span class="p">(</span><span class="n">v2</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">2*R_z</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="gradient">
<h3>gradient<a class="headerlink" href="#gradient" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.gradient">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">gradient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">scalar</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L99-L133"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.gradient" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the vector gradient of a scalar field computed wrt the
coordinate symbols of the given frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>scalar</strong> : sympifiable</p>
<blockquote>
<div><p>The scalar field to take the gradient of</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame to calculate the gradient in</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">gradient</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s1</span> <span class="o">=</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gradient</span><span class="p">(</span><span class="n">s1</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">R_y*R_z*R.x + R_x*R_z*R.y + R_x*R_y*R.z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s2</span> <span class="o">=</span> <span class="mi">5</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gradient</span><span class="p">(</span><span class="n">s2</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">10*R_x*R_z*R.x + 5*R_x**2*R.z</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="scalar-potential">
<h3>scalar_potential<a class="headerlink" href="#scalar-potential" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.scalar_potential">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">scalar_potential</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">field</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L200-L247"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.scalar_potential" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the scalar potential function of a field in a given frame
(without the added integration constant).</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>field</strong> : Vector</p>
<blockquote>
<div><p>The vector field whose scalar potential function is to be
calculated</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame to do the calculation in</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">scalar_potential</span><span class="p">,</span> <span class="n">gradient</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">scalar_potential</span><span class="p">(</span><span class="n">R</span><span class="o">.</span><span class="n">z</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span> <span class="o">==</span> <span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">scalar_field</span> <span class="o">=</span> <span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">grad_field</span> <span class="o">=</span> <span class="n">gradient</span><span class="p">(</span><span class="n">scalar_field</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">scalar_potential</span><span class="p">(</span><span class="n">grad_field</span><span class="p">,</span> <span class="n">R</span><span class="p">)</span>
<span class="go">2*R_x**2*R_y*R_z</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="scalar-potential-difference">
<h3>scalar_potential_difference<a class="headerlink" href="#scalar-potential-difference" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.scalar_potential_difference">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">scalar_potential_difference</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">field</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">point1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">point2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">origin</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L250-L313"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.scalar_potential_difference" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the scalar potential difference between two points in a
certain frame, wrt a given field.</p>
<p>If a scalar field is provided, its values at the two points are
considered. If a conservative vector field is provided, the values
of its scalar potential function at the two points are used.</p>
<p>Returns (potential at position 2) - (potential at position 1)</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>field</strong> : Vector/sympyfiable</p>
<blockquote>
<div><p>The field to calculate wrt</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame</p>
<blockquote>
<div><p>The frame to do the calculations in</p>
</div></blockquote>
<p><strong>point1</strong> : Point</p>
<blockquote>
<div><p>The initial Point in given frame</p>
</div></blockquote>
<p><strong>position2</strong> : Point</p>
<blockquote>
<div><p>The second Point in the given frame</p>
</div></blockquote>
<p><strong>origin</strong> : Point</p>
<blockquote>
<div><p>The Point to use as reference point for position vector
calculation</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">Point</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">scalar_potential_difference</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">O</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;O&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">O</span><span class="o">.</span><span class="n">locatenew</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">,</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">vectfield</span> <span class="o">=</span> <span class="mi">4</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">scalar_potential_difference</span><span class="p">(</span><span class="n">vectfield</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="n">O</span><span class="p">,</span> <span class="n">P</span><span class="p">,</span> <span class="n">O</span><span class="p">)</span>
<span class="go">2*R_x**2*R_y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span> <span class="o">=</span> <span class="n">O</span><span class="o">.</span><span class="n">locatenew</span><span class="p">(</span><span class="s1">&#39;O&#39;</span><span class="p">,</span> <span class="mi">3</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">R</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="mi">2</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">scalar_potential_difference</span><span class="p">(</span><span class="n">vectfield</span><span class="p">,</span> <span class="n">R</span><span class="p">,</span> <span class="n">P</span><span class="p">,</span> <span class="n">Q</span><span class="p">,</span> <span class="n">O</span><span class="p">)</span>
<span class="go">-2*R_x**2*R_y + 18</span>
</pre></div>
</div>
</dd></dl>

</section>
</section>
<section id="checking-the-type-of-vector-field">
<h2>Checking the type of vector field<a class="headerlink" href="#checking-the-type-of-vector-field" title="Permalink to this headline">¶</a></h2>
<section id="is-conservative">
<h3>is_conservative<a class="headerlink" href="#is-conservative" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.is_conservative">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">is_conservative</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">field</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L136-L165"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.is_conservative" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if a field is conservative.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>field</strong> : Vector</p>
<blockquote>
<div><p>The field to check for conservative property</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">is_conservative</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">is_conservative</span><span class="p">(</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">is_conservative</span><span class="p">(</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">*</span> <span class="n">R</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

</section>
<section id="is-solenoidal">
<h3>is_solenoidal<a class="headerlink" href="#is-solenoidal" title="Permalink to this headline">¶</a></h3>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.physics.vector.fieldfunctions.is_solenoidal">
<span class="sig-prename descclassname"><span class="pre">sympy.physics.vector.fieldfunctions.</span></span><span class="sig-name descname"><span class="pre">is_solenoidal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">field</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/vector/fieldfunctions.py#L168-L197"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.vector.fieldfunctions.is_solenoidal" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if a field is solenoidal.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>field</strong> : Vector</p>
<blockquote>
<div><p>The field to check for solenoidal property</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.vector</span> <span class="kn">import</span> <span class="n">is_solenoidal</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">R</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;R&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">is_solenoidal</span><span class="p">(</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">y</span> <span class="o">+</span> <span class="n">R</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">R</span><span class="o">.</span><span class="n">z</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">is_solenoidal</span><span class="p">(</span><span class="n">R</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">*</span> <span class="n">R</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

</section>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../../index.html">
              <img class="logo" src="../../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Docstrings for basic field functions</a><ul>
<li><a class="reference internal" href="#field-operation-functions">Field operation functions</a><ul>
<li><a class="reference internal" href="#curl">curl</a></li>
<li><a class="reference internal" href="#divergence">divergence</a></li>
<li><a class="reference internal" href="#gradient">gradient</a></li>
<li><a class="reference internal" href="#scalar-potential">scalar_potential</a></li>
<li><a class="reference internal" href="#scalar-potential-difference">scalar_potential_difference</a></li>
</ul>
</li>
<li><a class="reference internal" href="#checking-the-type-of-vector-field">Checking the type of vector field</a><ul>
<li><a class="reference internal" href="#is-conservative">is_conservative</a></li>
<li><a class="reference internal" href="#is-solenoidal">is_solenoidal</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="functions.html"
                        title="previous chapter">Essential Functions (Docstrings)</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../../mechanics/index.html"
                        title="next chapter">Classical Mechanics</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../../_sources/modules/physics/vector/api/fieldfunctions.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../mechanics/index.html" title="Classical Mechanics"
             >next</a> |</li>
        <li class="right" >
          <a href="functions.html" title="Essential Functions (Docstrings)"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" >The Physics Vector Module</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Docstrings for basic field functions</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/vector/api/fieldfunctions.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:28:35 GMT -->
</html>